package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.entity.ProductGuiGe;
import com.yunshang.shoppingmall.mapper.ProductGuiGeMapper;
import com.yunshang.shoppingmall.service.ProductGuiGeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("productGuiGeService")
public class ProductGuiGeServiceImpl implements ProductGuiGeService {
    @Autowired
    ProductGuiGeMapper productGuiGeMapper;

    @Override
    public int deleteByPrimaryKey(Integer gId) {
        return productGuiGeMapper.deleteByPrimaryKey(gId);
    }

    /**
     * 添加规格
     * @param productGuiGe
     * @return
     */
    @Override
    public int insert(ProductGuiGe productGuiGe) {
        return productGuiGeMapper.insert(productGuiGe);
    }

    @Override
    public int insertSelective(ProductGuiGe record) {
        return productGuiGeMapper.insertSelective(record);
    }

    /**
     * 根据规格id查询规格
     * @param guigeId
     * @return
     */
    @Override
    public ProductGuiGe selectByPrimaryKey(Integer guigeId) {
        return productGuiGeMapper.selectByPrimaryKey(guigeId);
    }

    @Override
    public int updateByPrimaryKeySelective(ProductGuiGe record) {
        return productGuiGeMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(ProductGuiGe record) {
        return productGuiGeMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<ProductGuiGe> selectGuigeListByProductId(Integer productId) {
        return productGuiGeMapper.selectGuigeListByProductId(productId);
    }


}
